﻿<Page
    x:Class="VivendoByteToolkit.Sample.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:VivendoByteToolkit.Sample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="using:VivendoByteToolkit.Sample.ViewModel"
    xmlns:helper="using:VivendoByteToolkit.Helpers"
    xmlns:ctl="using:VivendoByteToolkit.Controls"
    mc:Ignorable="d"
    Background="White">

    <Page.Resources>
        <vm:MainViewModel x:Key="viewmodel" />
    </Page.Resources>

    <Grid DataContext="{StaticResource viewmodel}" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <StackPanel VerticalAlignment="Center">
            <TextBlock FontSize="96" HorizontalAlignment="Center" Foreground="Black" TextWrapping="Wrap"
                   VerticalAlignment="Center" Text="{Binding Number}"
                   helper:SwipeCommandHelper.Up="{Binding IncrementCommand}"
                   helper:SwipeCommandHelper.Down="{Binding DecrementCommand}"
                   helper:SwipeCommandHelper.Right="{Binding MultiplyCommand}"
                   helper:SwipeCommandHelper.Left="{Binding DivideCommand}"
                   helper:WheelCommandHelper.Up="{Binding IncrementCommand}"
                   helper:WheelCommandHelper.Down="{Binding DecrementCommand}" />
            <TextBox Text="This textbox works as a standard WinRT TextBox: text is not automatically selected!" TextWrapping="Wrap"
                 FontSize="32" Foreground="Black" Margin="8" />
            <TextBox Text="Click on this textbox and the text is automatically selected" TextWrapping="Wrap"
                 FontSize="32" Foreground="Black" Margin="8"
                 helper:TextBoxHelper.AutoSelectAll="True" />
            <TextBox Text="{Binding Caption}" TextWrapping="Wrap"
                 FontSize="32" Foreground="Black" Margin="8"
                 helper:FocusCommandHelper.Got="{Binding GotFocusCommand}"
                 helper:FocusCommandHelper.Lost="{Binding LostFocusCommand}"
                 />
            <ctl:DatePicker FontSize="96" Foreground="Black" Date="{Binding Date}" />
            <ctl:NumberPicker FontSize="96" Foreground="Black" Background="Red" Number="10" Minimum="10" Maximum="50" />            
        </StackPanel>
        <StackPanel Grid.Column="1">
            <ListBox ItemsSource="{Binding Values}" Foreground="Black" FontSize="24"
                     helper:SelectionCommandHelper.Changed="{Binding SelectCommand}"
                     SelectedItem="{Binding ItemSelected,Mode=TwoWay}">

            </ListBox>
            <ctl:CurrencyPicker Amount="{Binding Price}" Foreground="Black" FontSize="96" />
            <Button Content="Create Toast Notification" Foreground="Black" HorizontalAlignment="Center" FontSize="24" Command="{Binding CreateToastCommand}" />
            <Button Content="Update Tile" Foreground="Black" HorizontalAlignment="Center" FontSize="24" Command="{Binding UpdateTileCommand}" />
        </StackPanel>
    </Grid>
</Page>